package day04;

import java.util.Scanner;

public class Practice02 {
    public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);
        int num = (int) (Math.random() * 100 + 1);
        System.out.println("来猜猜0-99的数吧");
        int guess;
        do {
            guess = scan.nextInt();
            if (guess < 0 || guess > 99) {//限制输入的数字,如果不在范围就重新输入
                System.out.println("输入有误请重新输出");
                guess = scan.nextInt();
            }
                if (guess > num) {
                    System.out.println("猜大了");
                } else if (guess < num) {
                    System.out.println("猜小了");
                }
            }
            while (guess != num) ;
            System.out.println("恭喜你猜对了");



       /* for (int i = 1; i <10 ; i++) {
            System.out.println(i+"*10="+i*10);
        }*///乘法表.但不是乘以的9


        /*System.out.println("来抽一发十连");
        System.out.println("请输入1,开始抽卡,输入其他数字直接结束");
        int j = scan.nextInt();
        if (j==1) {
            for (int i = 0; i < 10; i++) {//决定抽卡次数
                int num = (int) (Math.random() * 10);
                if (num == 0) {//抽到ssr的概率
                    System.out.println("ssr");
                } else if (num > 0 && num < 7) {//抽到r的概率
                    System.out.println("r");
                } else {//抽到sr的概率
                    System.out.println("sr");
                }
            }
        }else {
            System.out.println("游戏结束");
        }*///运用for循环的一个模拟抽卡系统

        /*Scanner sc = new Scanner(System.in);
        System.out.println("请选择你的职业1:saber,2:archer,3:lancer,4:caster,5:rider,6:assassin,7:berserker");
        int servant = sc.nextInt();
        switch (servant) {
            case 1:
                System.out.println("恭喜你获得ssr卡亚瑟王");
                break;
            case 2:
                System.out.println("恭喜你获得ssr卡红A");
                break;
            case 3:
                System.out.println("恭喜你获得ssr卡斯卡哈");
                break;
            case 4:
                System.out.println("恭喜获得sr卡美狄亚");
                break;
            case 6:
                System.out.println("恭喜你获得ssr卡山中老人");
                break;
            case 5:
                System.out.println("恭喜你获得sr卡美杜莎");
                break;
            case 7:
                System.out.println("恭喜你获得ssr卡阿周那");
                break;
            default:
                System.out.println("输入错误");
        }//switch*///switch
        }
    }
